<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%--
代码为自动生成 Created by www.magicalcoder.com
 如果你改变了此类 read 请将此行删除
 欢迎加入官方QQ群:323237052
--%>
<html>
<head>
    <%@include file="../../common/head.jsp"%>
    <title>权限编辑</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <%@include file="../include/head.jsp"%>
</head>
<body class="skin-blue">
    <header class="header">
        <%@include file="../include/top.jsp"%>
    </header>
    <div class="wrapper row-offcanvas row-offcanvas-left" id="formArea">
        <aside class="left-side sidebar-offcanvas">
            <%@include file="../include/left.jsp"%>
        </aside>
        <aside class="right-side">
            <section class="content-header">
                <h1>
                    权限详情
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="admin/index"><i class="fa fa-dashboard"></i> 主页</a></li>
                    <li><a href="admin/priority/list">权限列表</a></li>
                    <li class="active">权限详情</li>
                </ol>
            </section>
            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-primary">
                            <form class="form-horizontal" role="form" id="form" action="admin/priority/save" method="post">
                                <div class="box-header">
                                    <h3 class="box-title">
                                        <c:choose><c:when test="${priority.id==null}">新增</c:when><c:otherwise>编辑</c:otherwise></c:choose>
                                    </h3>
                                    <h3 class="box-title alert-danger">${exceptionMsg}</h3>
                                </div>
                                    <input type="hidden" name="id" value="${priority.id}">
                                <input type="hidden" id="queryParamCacheKey" name="queryParamCacheKey" value="${queryParamCacheKey}">

                                <div class="box-body">

                                    <%--priorityName 权限名 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">权限名</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control "  name="priorityName" title="权限名"   value="${priority.priorityName}" style="min-width: 100px;"  placeholder="请输入权限名">
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canInsert 新增 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">新增</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canInsert" title="新增"    <c:if test="${priority.canInsert!=null and !priority.canInsert }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canInsert" title="新增"    <c:if test="${ priority.canInsert==null or priority.canInsert }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canDelete 删除 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">删除</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canDelete" title="删除"    <c:if test="${priority.canDelete!=null and !priority.canDelete }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canDelete" title="删除"    <c:if test="${ priority.canDelete==null or priority.canDelete }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canUpdate 编辑 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">编辑</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canUpdate" title="编辑"    <c:if test="${priority.canUpdate!=null and !priority.canUpdate }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canUpdate" title="编辑"    <c:if test="${ priority.canUpdate==null or priority.canUpdate }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canQuery 查询 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">查询</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canQuery" title="查询"    <c:if test="${priority.canQuery!=null and !priority.canQuery }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canQuery" title="查询"    <c:if test="${ priority.canQuery==null or priority.canQuery }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canTruncate 清空 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">清空</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canTruncate" title="清空"    <c:if test="${priority.canTruncate!=null and !priority.canTruncate }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canTruncate" title="清空"    <c:if test="${ priority.canTruncate==null or priority.canTruncate }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canExport 导出 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">导出</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canExport" title="导出"    <c:if test="${priority.canExport!=null and !priority.canExport }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canExport" title="导出"    <c:if test="${ priority.canExport==null or priority.canExport }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canImport 导入 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">导入</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canImport" title="导入"    <c:if test="${priority.canImport!=null and !priority.canImport }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canImport" title="导入"    <c:if test="${ priority.canImport==null or priority.canImport }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--canStatistics 统计 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">统计</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="canStatistics" title="统计"    <c:if test="${priority.canStatistics!=null and !priority.canStatistics }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="canStatistics" title="统计"    <c:if test="${ priority.canStatistics==null or priority.canStatistics }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>
                                    <div class="form-group <c:if test="${ logAdminOperateId==null }">hidden</c:if> " id="historyOperateRecords">
                                        <label class="col-sm-1 control-label">
                                            历史记录
                                        </label>
                                        <div class="col-sm-9" style="min-width:120px">
                                            <select class="form-control" onchange="historySelectChange(this)">
                                                <option value="">请选择</option>
                                                <c:forEach var="log" items="${logAdminOperateList}">
                                                    <option <c:if test="${ log.id==logAdminOperateId }">selected</c:if> value="${log.id}"><fmt:formatDate value="${ log.createTime }" pattern="yyyy-MM-dd HH:mm:ss" />-${ log.userName }</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                    </div>
                                </div><!-- /.box-body -->
                                <div class="box-footer">
                                        <c:if test="${ adminPriority!=null and ((adminPriority.canInsert and priority.id==null) or (adminPriority.canUpdate and priority.id!=null))}">
                                            <button type="button" onclick="submitForm2('#formArea','#form',realSubmit)" class="btn btn-danger">保存</button>
                                        </c:if>
                                        <button type="button" onclick="returnToListPage('priority','${queryParamCacheKey}','${priority.id}')"  class="btn btn-primary">返回</button>
                                    <button type="button" onclick="historySelectShow()"  class="btn btn-primary">显示历史记录</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </section>

            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="nav-tabs-custom">
                            <ul class="nav nav-tabs">
                            </ul>
                            <div class="tab-content">
                            </div>
                        </div>
                    </div>
                </div>
            </section>

        </aside>
    </div>

    <div class="hidden">
    </div>
    <%@include file="../include/tail.jsp"%>

    <script type="text/javascript" >
        $(function(){
            //base.js
            validateForm2($("#formArea"))
            //inputSelect
            initSingleSelect2Ajax($("section"))
            autoSetSingleSelect2Value($("section"))
        })
        function realSubmit(){
            var form = $("#form")
            var priority = findFormData(form)
                priority.date = new Date().getTime()
                $.post("admin/priority/ajax_save",priority,function(data){
                    if(data.code != 0){
                        alert(data.message)
                    }else {
                        var relateId = data.info
                    }
            })
        }
    </script>
</body>
</html>
